package com.cta.dao;

import java.util.List;

import com.cta.constant.ROLE;
import com.cta.entity.Contact;
import com.cta.entity.PBX;
import com.cta.entity.Site;
import com.cta.utils.SupportLoaderDelegate;

public interface SitePersistence extends BasePersistence {

	/**
	 * find all Sites
	 * 
	 * @return
	 */
	public List<Site> findAllSites();
	
	/**
	 * find all child site of parent id
	 * 
	 * @param parentId
	 * @return
	 */
	public List<Site> findAllChildSite(Long parentId) ;
	
	/**
	 * find root Site
	 * 
	 * @return
	 */
	public Site findRootSite() ;
	
	/**
	 * find site by name
	 * @param name
	 * @return
	 */
	public Site findSiteByName(String name) ;
	
	/**
	 * find all Contact by parentId( assignTo )
	 * @param parentId
	 * @return
	 */
	public List<Contact> findContactByParentId(Long parentId) ;
	
	/**
	 * find all PBX by parentId (assignTo)
	 * @param parentId
	 * @return
	 */
	public List<PBX> findPBXByParentId(Long parentId)  ;
	
	/**
	 * find pbx by factory id
	 * @param factoryId
	 * @return
	 */
	public List<PBX> findPBXByFactoryId(Long factoryId) ;
	
	/**
	 * find all PBX with eager service factory load
	 * @param parentId
	 * @return
	 */
	public List<PBX> findAllPBX(SupportLoaderDelegate<PBX> loader) ;
	
	/**
	 * find all PBX which are not assigned to site node and  eager service factory load
	 * @param parentId
	 * @return
	 */
	public List<PBX> findAllPBXNotAssign(SupportLoaderDelegate<PBX> loader) ;
	
	/**
	 * find all contact except super admin
	 * @return
	 */
	public List<Contact> findAllContactExceptSuperAdmin() ;
	
	/**
	 * get all admin contact
	 * @return
	 */
	public List<Contact> findAllAdminContact() ;
	
	/**
	 * get all normal contact
	 * @return
	 */
	public List<Contact> findAllNormalContact() ;
	
	/**
	 * find all contact except super admin
	 * @return
	 */
	public List<Contact> findAllContactExceptSuperAdminAndNotAssign() ;
}
